#worker
from celery import Celery

#1.从manage.py导入与项目的链接    为celery能使用django的setting
import os

if not os.getenv('DJANGO_SETTINGS_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'mall.settings'

#2.创建celery实例对象
app = Celery(main='celery_tasks')

#3.导入分发/保存，结果的数据库保存位置
app.config_from_object('celery_tasks.config')

#4自动加载任务
app.autodiscover_tasks(['celery_tasks.sms','celery_tasks.email','celery_tasks.html'])
